package com.mybed.crm.controller;

import com.mybed.crm.pojo.pojo.Notice;
import com.mybed.crm.result.PageResult;
import com.mybed.crm.result.Result;
import com.mybed.crm.service.NoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/notice")
@Slf4j
//通知中心
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    /**
     * 查询通知是否已读
     * @param status
     * @return
     */
    @GetMapping("/pagelist/{status}")
    public PageResult selectNotice(@PathVariable Integer status){
        log.info(String.valueOf(status));
        PageResult<Notice> notices = noticeService.selectNotice(status);
        return notices;
    }

}
